import request from '@/utils/request'
import scope from './scope'
const apiPrefix = `${process.env.VUE_APP_BASE_API}/${scope}/sysjob/`

export const getJobList = (params, config = {}) => {
  params = params || {}
  return request.get(apiPrefix + 'list', { params: params }, config)
}
export const removeJob = (params, config = {}) => {
  return request.post(apiPrefix + 'delete', params, config)
}
export const addJob = (params, config = {}) => {
  return request.post(apiPrefix + 'add', params, config)
}
export const resumeJob = (params, config = {}) => {
  return request.post(apiPrefix + 'resume', params, config)
}
export const pause = (params, config = {}) => {
  return request.post(apiPrefix + 'pause', params, config)
}
export const jobSelect = (params, config = {}) => {
  params = params || {}
  return request.get(apiPrefix + 'jobselect', { params: params }, config)
}
export const stop = (params, config = {}) => {
  return request.post(apiPrefix + 'stop', params, config)
}
export const getLogs = (params, config = {}) => {
  params = params || {}
  return request.get(apiPrefix + 'log', { params: params }, config)
}
